package com.shiroha.account.config.security.keycloak;

import lombok.Getter;

@Getter
public enum KeycloakErrorCode {

    ERR_USER_NOT_FOUND("USER_NOT_FOUND", "用户不存在"),
    ERR_AUTH_INVALID("AUTH_INVALID", "用户名和密码不可为空"),
    ERR_AUTH_FAILED("AUTH_FAILED", "认证失败，用户名或密码不正确"),
    ERR_USER_CREATION_INVALID("USER_CREATION_INVALID", "用户名不可为空"),
    ERR_USER_CREATION_FAILED("USER_CREATION_FAILED", "用户创建失败，可能是因为用户名已存在"),
    ERR_TOKEN_EXPIRED("TOKEN_EXPIRED", "令牌已过期，请重新登录"),
    ERR_KEYCLOAK_ACCESS_FAILED("KEYCLOAK_ACCESS_FAILED", "访问 Keycloak 失败，请检查服务器状态或配置"),
    ERR_RESET_PASSWORD("RESET_PASSWORD", "密码修改出错");

    private final String code;
    private final String message;

    KeycloakErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }
}
